/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Acer
 */
@Entity
@Table(name = "tb_PhotoGallery", catalog = "East2West_TourAndTravel", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "TbPhotoGallery.findAll", query = "SELECT t FROM TbPhotoGallery t"),
    @NamedQuery(name = "TbPhotoGallery.findByPgID", query = "SELECT t FROM TbPhotoGallery t WHERE t.pgID = :pgID"),
    @NamedQuery(name = "TbPhotoGallery.findByPgImage", query = "SELECT t FROM TbPhotoGallery t WHERE t.pgImage = :pgImage"),
    @NamedQuery(name = "TbPhotoGallery.findByPgDescription", query = "SELECT t FROM TbPhotoGallery t WHERE t.pgDescription = :pgDescription")})
public class TbPhotoGallery implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pg_ID", nullable = false)
    private Integer pgID;
    @Column(name = "pg_Image", length = 50)
    private String pgImage;
    @Column(name = "pg_Description", length = 100)
    private String pgDescription;
    @JoinColumn(name = "tour_ID", referencedColumnName = "tour_ID")
    @ManyToOne
    private TbTours tourID;

    public TbPhotoGallery() {
    }

    public TbPhotoGallery(Integer pgID) {
        this.pgID = pgID;
    }

    public Integer getPgID() {
        return pgID;
    }

    public void setPgID(Integer pgID) {
        this.pgID = pgID;
    }

    public String getPgImage() {
        return pgImage;
    }

    public void setPgImage(String pgImage) {
        this.pgImage = pgImage;
    }

    public String getPgDescription() {
        return pgDescription;
    }

    public void setPgDescription(String pgDescription) {
        this.pgDescription = pgDescription;
    }

    public TbTours getTourID() {
        return tourID;
    }

    public void setTourID(TbTours tourID) {
        this.tourID = tourID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pgID != null ? pgID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbPhotoGallery)) {
            return false;
        }
        TbPhotoGallery other = (TbPhotoGallery) object;
        if ((this.pgID == null && other.pgID != null) || (this.pgID != null && !this.pgID.equals(other.pgID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.TbPhotoGallery[pgID=" + pgID + "]";
    }

}
